<?php

class Frontend
{
	public $load;
	
	function main()
	{
		$ver = $this->load->get_latest_info();
		if(substr($ver['build'], -2, 2) > substr(SWIXSBUILD, -2, 2))
		{
			$status = 'Outdated (' . $ver['passed'] . ' months old)';
		}
		else
		{
			$status = 'Updated';
		}
		SQL::exec()->select()->from('dashboard_login_logs')->where(array('success' => 0, 'unread' => 1))->run();
		$attempts = SQL::num_rows();
		$this->load->display->column(
			$this->load->display->box('Notepad', 
				'<div class="errors"></div>' .
				$this->load->display->form('textpad', '#',
					$this->load->display->textarea('notes', $this->load->dashboard->notepad, array('class' => 'notes')) .
					$this->load->display->submit('Update')
				)
			)
		);
		$this->load->display->column(
			$this->load->display->box('Information',
				$this->load->display->item('Version', SWIXSVERSION . ' (Build ' . SWIXSBUILD . ')') .
				$this->load->display->item('Platform', $this->load->platform_info()) .
				$this->load->display->item('MySQL', SQL::version()) .
				$this->load->display->item('Status', $status)
			) .
			$this->load->display->box('Logs',
				$this->load->display->item('Dashboard Login', '<span style="color: #FF0000;" id="login">' . $attempts . ' Failed Attempts</span>') .
				$this->load->display->item('Spam Queue', '<span style="color: #087400;">Empty</span>')
			)
		);
		

	}
}
?>